package com.maiji.cloud.service;

import com.baomidou.mybatisplus.service.IService;
import com.maiji.cloud.entities.login.AppUser;
import com.maiji.cloud.entities.shopingmall.DistributionUserRuleLog;
import com.maiji.cloud.request.BaseDataReqDto;
import com.maiji.cloud.request.ReqMetaData;
import com.maiji.cloud.response.BaseDataResDto;
import com.maiji.cloud.response.BaseMetaResDto;
import com.maiji.cloud.response.BaseResDto;
import com.maiji.cloud.response.login.AppUserResData;

import java.util.HashMap;
import java.util.Date;
import java.util.List;

public interface AppUserService extends IService<AppUser> {

    BaseDataResDto<String> logon(String tel, String code, String pwd, String distributionNum);

    void logonPidCount(AppUser appUser);

    void logoffPidCount(AppUser appUser);

    BaseDataResDto<String> login(String tel, String pwd, String code, String openId, String qqId, String wbId, String distributionNum);

    BaseResDto logout(String token);

    BaseDataResDto<String> updatePwd(String maijiToken, String tel, String code, String oldPwd, String pwd);

    BaseDataResDto<String> updateTel(String tel, String code, String token);

    BaseDataResDto<AppUserResData> bindTel(String tel, String code, String openId, String qqId, String wbId,
                                           String nickName, String headUrl, String distributionNum);

    AppUser checkToken(String maijiToken);

    AppUser checkToken(String maijiToken, Boolean isOfficial);

    Boolean checkCode(String tel, String code);

	BaseResDto logoutAccount(BaseDataReqDto<String> param, String maijiToken);

    BaseMetaResDto<List<AppUserResData>> findAllDistributionUsers(String pid, String nickName, String tel, ReqMetaData metaData);

    BaseResDto editDistributionUser(AppUser appUser);

    BaseDataResDto<HashMap<String, Integer>> findDistributionUserCount();

    BaseDataResDto<List<DistributionUserRuleLog>> findAllDistributionUserRuleLogs(String userId, String nickName, List<Date> editDates);

    BaseResDto banAppUser(AppUser appUser);

    void deleteAppUserByRedis(String maijiToken);

    BaseResDto checkLogon(String tel);

}
